package com.qf.ability.auth.controller;

import com.qf.ability.auth.service.AuthService;
import com.qf.data.auth.vo.input.WxAuthUserInput;
import com.qf.data.base.r.R;
import com.qf.data.base.r.Rs;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

/**
 * description:
 * author: Ken
 * 公众号：Java架构栈
 */
@RestController
@RequestMapping("/auth/wx")
public class AuthController {

    @Autowired
    private AuthService authService;

    /**
     * 微信小程序端的登录
     * @return
     */
    @RequestMapping("/login")
    public R wxLogin(@Valid WxAuthUserInput authUserInput){
        String jwtToken = authService.wxlogin(authUserInput);
        return Rs.create(jwtToken);
    }
}
